//
//  LBProgram.h
//  OpenGLGame
//
//  Created by Nguyen Cong Huy on 11/12/12.
//  Copyright (c) 2012 UIT. All rights reserved.
//


/**
 Do not use use() in your code. Use a program by LBGraphics::getInstance()->useProgram(GLuint program).
 */
#ifndef OpenGLGame_LBProgram_h
#define OpenGLGame_LBProgram_h

#include <list>
using namespace std;

class LBProgram {
    GLuint program, vertShader, fragShader;
    bool initialized;
    
public:
    LBProgram(const char* vShaderString, const char* fShaderString);
    GLuint attributeIndex(const char* attributeName);
    GLuint uniformIndex(const char* uniformName);
    void use();
    void validate();
    bool link();
    virtual ~LBProgram();
    
private:
    
    bool compileShader(GLuint* shader, GLenum type, const char* shaderString);
    
};

#endif
